<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld"  prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld"  prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/custom-html.tld"  prefix="chtml" %>

<%@ page import="com.erp.framework.util.CommonUtil"%>
<%@ page import="com.erp.app.common.ProjectConstants"%>
<%@ page import="com.erp.app.catalog.login.web.CatalogLoginAction"%>
<%@ page import="com.erp.app.catalog.login.web.CategoryItemCategoryRow"%>
<%@ page import="com.erp.app.catalog.login.web.CategoryItemClassRow"%>
<%@ page import="com.erp.app.catalog.itemMaster.vo.ItemMasterVO"%>
<%@ page import="com.erp.app.catalog.itemMaster.vo.ItemMasterPriceVO"%>

<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Iterator"%>

<jsp:useBean id="catalogLoginForm" scope="session" type="com.erp.app.catalog.login.web.CatalogLoginForm" />

<SCRIPT LANGUAGE="JavaScript">
<!--
	function preparesend (){
  		document.forms[0].subject.value ='Product Information';
    	document.forms[0].body.value='Art #   ';	  									
		doSubmit('itemSendEmail');
	  }

	 
//-->
</SCRIPT>

<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" href="stylesheet/style1.css" type="text/css">
<link href="<%= request.getContextPath()%>/css/catalogCss/global.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/buttons.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/forms.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/tables.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="<html:rewrite page="/stylesheet/style.css" />" type="text/css">
<link rel="stylesheet" href="<html:rewrite page="/stylesheet/style1.css" />" type="text/css">
<style>
		

	div.largerImagebuttonPanel1 {
		margin:0px;
		height:25px;
		width:120px;
		cursor:hand;
		background-image: url("<%=request.getContextPath()%>/images/catalogImages/button/over_larger_button.gif");
		color: #FFFFFF;
		font-size: 10pt;
		font-family: Arial, Helvetica, sans-serif;
	}
	div.largerImagebuttonPanel2 {
		margin:0px;
		height:25px;
		width:120px;
		cursor:hand;
		background-image: url("<%=request.getContextPath()%>/images/catalogImages/button/out_larger_button.gif");
		color: #000000;
		font-size: 10pt;
		font-family: Arial, Helvetica, sans-serif;
	}

	button.largerImagebutton {
		background-color: transparent;
		height:25px;
		width:120px;
		border:0;
	}

	

	button.showImagebutton {
		background-color: transparent;
		height:20px;
		width:20px;
		border:0;
	}
</style>

<%	
	ItemMasterVO itemMasterVO = catalogLoginForm.getItemMasterVO();
	pageContext.setAttribute("itemVo", itemMasterVO);
	pageContext.setAttribute("itemVoPic", itemMasterVO.getItemPicVO());
//	String imgFile = request.getContextPath() + ProjectConstants.DEFAULT_NO_FOUND_PRODUCT_IMAGE_PATH + "/"	+ ProjectConstants.DEFAULT_NO_FOUND_PRODUCT_IMAGE_NAME;
%>

<html:hidden property="body" />
<html:hidden property="subject"/>
<html:hidden property="currPicIdx"/>

<table border="0" cellspacing="0" cellpadding="0" align="left">
	<tr>
	<td width="350">
	   <logic:present name="itemVo" property="itemPicVO">
			  <logic:iterate id="itemPic" name="itemVo" property="itemPicVO" indexId="idx"  type="com.erp.app.catalog.itemMaster.vo.ItemMasterPicVO">
			  		<%if(catalogLoginForm.getCurrPicIdx()==idx.intValue()){ %>
					 <table>
						 <tr>
							<td>			
								<div>				
									<img src="<%=catalogLoginForm.getMaintImageFile(request,itemPic,idx.intValue())%>"
											border="0" width="306" height="300" />
								</div>			
							</td>		
						 </tr>
						 <tr>		
							<td>
								<button onClick="currPicIdx.value--;doSubmit('doNothing');"
										<%=(idx.intValue()==0)?"disabled":""%>>
									 <<
								</button>
								&nbsp;
								<button class="largerImagebutton" onClick="javascript:doSubmit('showPic');" >
									<div class="largerImagebuttonPanel1" onMouseover="this.className='largerImagebuttonPanel2'" onMouseout="this.className='largerImagebuttonPanel1'">
										<div class="largerImagebuttonPanel2" onMouseover="this.className='largerImagebuttonPanel1'" onMouseout="this.className='preImagebuttonPanel2'">
											<div style="padding-top:6px;">
												<img src="<%=request.getContextPath()%>/images/catalogImages/images/details_page_19.gif"
															 width="8px" height="8px" border="0" />&nbsp; zoom in &nbsp;
											</div>
										</div>
									</div>
								</button>
								&nbsp;
								<%int size= itemMasterVO.getItemPicVO().size();%>
								<button onClick="currPicIdx.value++;doSubmit('doNothing');"
										<%=(idx.intValue()==size-1)?"disabled":""%>>				
									>> 				
								</button>			
							</td>	
						</tr>
					</table>
					<%}%>
				</logic:iterate>
		   </logic:present> 
      <%if(itemMasterVO.getItemPicVO()==null || itemMasterVO.getItemPicVO().size()==0){%>
			<table>
				<tr>
					<td >
						<div style="border:1px solid #ccc">
							<img src="<%=catalogLoginForm.getMaintImageFile(request, null, 0)%>" border="0" width="306" height="300" />
						</div>		
					</td>
					<td align="left" >
					      <table>
						     
						  </table>
					</td>
				</tr>
				<tr>
					<td>
						&nbsp;
						<button class="largerImagebutton" onClick="javascript:doSubmit('showPic','');" >
							<div class="largerImagebuttonPanel1" onMouseover="this.className='largerImagebuttonPanel2'" onMouseout="this.className='largerImagebuttonPanel1'">
								<div class="largerImagebuttonPanel2" onMouseover="this.className='largerImagebuttonPanel1'" onMouseout="this.className='preImagebuttonPanel2'">
									<div style="padding-top:6px;">
										<img src="<%=request.getContextPath()%>/images/catalogImages/images/details_page_19.gif"
													 width="8px" height="8px" border="0" />&nbsp; zoom in &nbsp;
									</div>
								</div>
							</div>
						</button>
						
						&nbsp;
					</td>
					<td></td>
				</tr>
			</table>
      <%}%>
     </td>
	<logic:present name="itemVo" property="itemDtlVO">
		<td >
			<table border="1" cellspacing="0" cellpadding="0" width="320" height="150" align="left" style="margin-left:10px;margin-top:30px">		
				<tr id="row_top">
				   	<td algin="cell_pad_details" style="font-size:12px">
				   		<label>Fabric Code:</label>
				   	</td>
                   	<td algin="cell_pad_details" style="font-size:12px">
                   		<%=itemMasterVO.getFabricCode()%>
                   	</td>
				</tr>
				<tr id="row_top">
				   	<td algin="cell_pad_details" style="font-size:12px">
				   		<label>Fabric Construction:</label>
				   	</td>
					   <% String where = " company_code='"+itemMasterVO.getCompanyCode()+
				              "' and FABRIC_CODE='"+itemMasterVO.getFabricCode()+"'";%>
					<td algin="cell_pad_details" style="font-size:12px">
					      <chtml:desc table="t_fabric_hdr"
					               column="CONSTRUCTION"
								   where="<%=where%>"/>
					</td>					
				</tr>
				<logic:iterate id="itemDtl" name="itemVo" property="itemDtlVO" indexId="idx"  type="com.erp.app.catalog.itemMaster.vo.ItemMasterDtlVO">
					<tr id="row_top">
						<td id="cell_pad_details" style="font-size:12px">
							<label><bean:write name="itemDtl" property="dtlName"/></label>
						</td>
						<td id="cell_pad_details" style="font-size:12px">
							<bean:write name="itemDtl" property="dtlValue"/>
						</td>
					</tr>
				</logic:iterate>
			</table>
		</td>
	</logic:present>
</tr>
</table>